﻿$(function () {
    $.ajax({
        type: 'POST',
        async: false,
        contentType: 'application/json; charset=utf-8',
        url: '../DataService.asmx/GetLocationForCurrentEvent',
        data: '{}',
        dataType: 'json',
        success: function (msg) {
            var map;
            var geocoder;
            $('#address').html(msg.d.Location);
            initialize(msg);
        },
        error: function () {
            alert("Problem occured while loading map");

        }
    });
});

//initializing google map
function initialize(msg) {
    var mapOptions = {
        center: new google.maps.LatLng(msg.d.Latitude, msg.d.Longitude),
        zoom: 18,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map(document.getElementById("map-canvas"),
        mapOptions);
}